package com.dubbo.cp.provider.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.dubbo.cp.entity.CourseEntity;


@Mapper
public interface CourseMapper {
	
	@Select("select * from course where id = #{id}")
	public CourseEntity findCourseByCourseid(@Param("id")int id);

	@Select("select * from course where 1 = 1")
	public List<CourseEntity> getCourseList();
	
	@Select("select * from course where courseName = #{courseName}")
	public CourseEntity findRoleByCourse(@Param("courseName")String courseName);
	
	@Insert("insert into course(courseName) values(#{courseName})")
	public void insertCourseEntity(CourseEntity courseEntity);
	
	@Delete("delete from course where id = #{id}")
	public void deleteById(int id);
	
	@Update("update course set courseName = #{courseName} where id = #{id}")
	public void UpdateCourseEntity(CourseEntity courseEntity);
	
	@Select("select * from course limit #{arg0},#{arg1} ")
	public List<CourseEntity>getRoleByPage(int start, int size);//分页查询角色的信息
	
}
